
#include <iostream>
#include <string>
using namespace std;
bool issymmet(string& s1) {
    int begin = 0, end = s1.size() - 1;
    while (begin < end) {
        if (s1[begin] != s1[end])return false;
        begin++;
        end--;
    }
    return true;
}
int main() {
    int count = 0;
    string s1;
    string s2;
    getline(cin, s1);
    getline(cin, s2);
    for (size_t i = 0; i <= s1.size(); ++i) {
        string tem(s1);
        tem.insert(i, s2);
        if (issymmet(tem))count++;
    }
    cout << count << endl;
    return 0;
}